<%-- 
    Document   : RegisterCharge
    Created on : Sep 5, 2013, 10:03:30 PM
    Author     : Thanh
--%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Set"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link type="text/css" href="css/style.css" rel="stylesheet">
        <title>Payment</title>

    </head>
    <body>        
        <%
            /*HashMap hm = (HashMap) request.getSession().getAttribute("Charges_data");
             Set charge = hm.keySet();
             Iterator itr = charge.iterator();*/
            HttpSession ss = request.getSession(true);
            if (ss.getAttribute("login") == null) {
                response.sendRedirect("index.jsp");
            }

            HashMap hm = (HashMap) request.getSession().getAttribute("Charges_data");
            Set charges = hm.keySet();
            Iterator itr = charges.iterator();

            Date today = new Date(System.currentTimeMillis());
            SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
            String todayStr = dateFormat.format(today.getTime());
            String username = (String) request.getSession().getAttribute("login");
        %>        
        <table border="0" width="70%">
            <tr>
                <td valign="top" width="30%">                    
                </td>
                <td>    <form name="frmCharge" method="POST" action="PaymentRegister">                
                        <table border="0">
                            <thead>
                                <tr>
                                    <th colspan="2" align="left" class="text-lager-title-reb">Payment</th>                                
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>Charge ID:</td>
                                    <td><select name="ddlChargeID" class="gwt-Combobox-Register">
                                            <%
                                                while (itr.hasNext()) {
                                                    Object keyid = itr.next();
                                                    HashMap hm2 = (HashMap) hm.get(keyid);
                                            %>
                                            <option><%= hm2.get("id_charges")%></option>
                                            <%
                                                }
                                            %>
                                        </select></td>
                                </tr>
                                <tr>
                                    <td class="text-nomarl-title-reb" align="left">Username:</td>
                                    <td align="left"><input type="text" name="txtUserid" value="<%out.println(username);%>" readonly="readonly" class="gwt-TextBox-Register"/></td>
                                </tr>
                                <tr>
                                    <td class="text-nomarl-title-reb" align="left">Date:</td>
                                    <td align="left"><input type="text" name="txtDate" value="<%out.println(todayStr);%>" readonly="readonly" class="gwt-TextBox-Register"/></td>
                                </tr>
                                <tr>
                                    <td align="left" class="text-nomarl-title-reb">Card No.:</td>
                                    <td align="left"><input type="text" name="txtCardNo" value="" class="gwt-TextBox-Register"/></td>
                                </tr>
                                <tr>
                                    <td align="left" class="text-nomarl-title-reb">Card Type:</td>
                                    <td align="left"><select name="ddlCardType" class="gwt-Combobox-Register">
                                            <option>Visa</option>
                                            <option>Master Card</option>
                                            <option>ATM</option>
                                        </select></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td align="left"><input type="submit" value="Submit" class="button" /></td>
                                </tr>
                            </tbody>
                        </table> </form>                   
                </td>
            </tr>
        </table>    
    </body>
</html>
